package com.yzy.fly.mapper;

import com.yzy.fly.entity.core.FlyFieldAnnotation;
import com.yzy.fly.kernel.mapper.FlyBasicMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface FlyFieldAnnotationMapper extends FlyBasicMapper<FlyFieldAnnotation> {

    @Select("select * from fly_field_annotation a where 1=1 order by a.seq asc")
    List<FlyFieldAnnotation> selectAll();

    @Select("select * from fly_field_annotation a where 1=1 and a.fieldId = #{fieldId} order by a.seq asc")
    List<FlyFieldAnnotation> selectAllByFieldId(@Param("fieldId") int fieldId);

    @Select("select * from fly_field_annotation a where 1=1 and a.name = #{name}")
    FlyFieldAnnotation selectOneByName(@Param("name") String name);

}